import { Controller, Get, Logger } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
  // 创建日志实例
  private logger = new Logger();
  constructor(private readonly appService: AppService) {}

  @Get()
  getHello(): string {
    // 日志打印
    this.logger.debug('调试', AppController.name)
    this.logger.debug('调试');
    this.logger.error('错误');
    this.logger.log('标准');
    this.logger.verbose('详细');
    this.logger.warn('警告');
    this.logger.fatal('致命');
    return this.appService.getHello();
  }
}
